Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome/Safari ignore Content-Disposition filename on save if disposition type is inline #25456

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Dec 18, 2024

Adding a note about behavior that deviates in Chrome in the following condition:

Content-Disposition: inline; filename="something"

background:

Usually, the filename parameter is used to prefill the file name for attachment types -> this triggers a save-as dialog immediately on navigation:

Content-Disposition: attachment; filename=example.html

inline means the user agent is supposed to render the document "as usual" instead of prompting the user to download. In this case, adding a filename is allowed for cases where the user saves the document at a later stage. I've added some more details in the linked issue.

actual behavior:

Chrome uses the document title (PDF / HTML) instead of the filename parameter, which may be unexpected for some developers.

Test results and supporting details

It's visible in the linked BCD issue and there are multiple reproducers in the Chrome bug.

Related issues

Fixes #18108

@github-actions github-actions bot added data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP size:xs [PR only] 0-6 LoC changed labels Dec 18, 2024
@github-actions github-actions bot added size:s [PR only] 7-24 LoC changed and removed size:xs [PR only] 0-6 LoC changed labels Dec 20, 2024
@caugner caugner changed the title Chrome ignores filename param on save when disposition type is inline Chrome/Safari ignore Content-Disposition filename on save if disposition type is inline Dec 20, 2024
@caugner caugner merged commit d681c9c into mdn:main Dec 20, 2024
9 checks passed
@bsmth bsmth deleted the 18108-content-disposition branch December 20, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP size:s [PR only] 7-24 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http.headers.Content-Disposition - Chrome support is incomplete
2 participants